package com.group5.onlinegame.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.group5.onlinegame.dao.IIpDao;
import com.group5.onlinegame.entity.Ip;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class IpService implements IIpService{

    @Resource
    private IIpDao iIpDao;
    @Override
    public PageInfo<Ip> getIpList(Integer pageNum) {
        PageHelper.startPage(pageNum,5,"id desc");
        PageInfo<Ip> pageInfo=new PageInfo<>(iIpDao.getIpList());
        return pageInfo;
    }

    @Override
    public int delallip(int[] id) {
        return iIpDao.delallip(id);
    }

    @Override
    public int addip(Ip ip) {
        return iIpDao.addip(ip);
    }

    @Override
    public Ip getIpById(int id) {
        return iIpDao.getIpById(id);
    }

    @Override
    public int editip(Ip ip) {
        return iIpDao.editip(ip);
    }

    @Override
    public int deloneip(int id) {
        return iIpDao.deloneip(id);
    }
}
